import React from 'react'
import { View, Swiper, SwiperItem, Image } from '@tarojs/components'
import { Banner } from './declare'


export interface IBannerProps {
    items: Banner[]
}
export const BannerEle: React.FC<IBannerProps> = ({ items }) => {

    return (
        <View className="xxm-banner">
            <Swiper
                style={{ height: '100%' }}
                indicatorDots
                indicatorColor="#bbb"
                indicatorActiveColor="#fff"
                autoplay
            >
                {
                    items?.map((it, idx) => {
                        return (
                            <SwiperItem key={idx + it.image_url} className="xxm-banner__item">
                                {/* <View className="xxm-banner__item"> */}
                                <Image src={it.image_url} />
                                {/* </View> */}
                            </SwiperItem>
                        )
                    })
                }
            </Swiper>
        </View>
    )
}